<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>扫码送{$name}</title>
	<meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="format-detection" content="telephone=no">
	 <link rel="stylesheet" href="../addons/tiger_jifenbao/template/js/sweetalert.css?i={TIMESTAMP}">
	<meta charset="utf-8">
	<style>
		html, body {
			height: 100%;
			background-color:#EFEFF5;
			margin: 0;
			padding: 0;
		}
		.coupon{
			margin:0 auto;
			width:100%;
			height:auto;
			background-color:#4977DA;
		}
		.gongzhonghao{
			padding:8%;
			height:auto;
			font-size:20px;
		}
		.gongzhonghao img{
			vertical-align:middle;
			width:13%;
			height:auto;
		}
		.gongzhonghao span{
			padding-left:5%;
			color:white;
			font-size:20px;
		}
		.couponArea{
			width:100%;
			<!-- padding:0 10%; -->
			height:auto;
			font-size:20px;
		}
		.couponTitle,.couponDetails{
			text-align:center;
			color:white;			
		}
		.couponTitle{
			font-size:24px;
			padding-bottom: 10%;
 			padding-top: 0;
		}
		.couponDetails{
			font-size:18px;
			 padding-bottom: 0;
  			margin-bottom: 0;
		}
		.other{
			padding-top:5%;
			height:10%;
			text-align:center;
			font-size:13px;
		}
		.lingqu{
			margin:0 auto;
			width:100%;
			height:auto;
			margin-top: 20px;
		}
		.lingqu .take{			
			background-color: #34BE23;
			width: 80%;
			height: 50%;
			display: block;
			margin: 0 auto;
			text-align: center;
			line-height: 60px;
			color: white;
			  border-radius: 5px;
		}
		
		.lingqu .tips{
			  text-align: center;
			  color: #4977DA;
			  display: block;
			  font-size: 20px;
			  text-decoration: none;
		}


/*J-album样式*/

#J-album {

	margin: 0 auto;

	/*background-color: #FFFFFF;*/

	width: 100%;

	overflow: hidden;
	
	position: absolute;
  	bottom: 0;
  	
  	height: {$items['slideH']}px;

}

#J-album img{
	height: {$items['slideH']}px;
}


#J-album-wp {

	width: 100%;

	margin: 0 auto;

	height: auto;

	overflow: hidden;

	z-index: 1;

}



.scroller {

	height: auto;

	overflow: hidden;

}



.scroller ul {

	display: block;

	overflow: hidden;

	height: auto;

	margin: auto;

	padding: 0;

	text-align: center;

}



.scroller li {

	width: auto;

	height: auto;

	display: block;

	float: left;

	text-align: center;

}



#J-album-nav {

	float: right;

	right: 3%;

	margin-top: -20px;

	padding: 0;

	position: relative;

	width: auto;

	z-index: 300;

}



#indicator>li {

	display: block;

	float: left;

	list-style: none;

}



#indicator {

	display: block;

	margin: 0 8px;

	padding: 0;

	width: auto;

}



#indicator>li {

	text-indent: -9999em;

	width: 8px;

	height: 8px;

	-webkit-border-radius: 4px;

	-moz-border-radius: 4px;

	border-radius: 4px;

	background: #888;

	overflow: hidden;

	margin-right: 4px;

}



#indicator>li.active {

	background: #DDDDDD;

}



#indicator>li:last-child {

	margin: 0;

}
	</style>
</head>
<body>
	<div class="coupon">
		<div class="gongzhonghao">
			<img src="{$_W['account']['avatar']}" /><span>{$_W['account']['name']}</span>
		</div>
		<div class="couponArea">
			<p class="couponDetails">恭喜您！将可获得</p>
			<p class="couponTitle">{$items['score1']}{$name}</p>
			<p></p>
		</div>
	</div>
	<div class="lingqu">
		{if !$record}
			<a class="take" onclick="take()">领取{$name}</a>
		{else}
			<a class="tips" href="{$items['tipsurl']}"><pre>{$items['mtips']}</pre></a>
		{/if}
	</div>
	
<div id="J-album">

	<div id="J-album-wp">

		<!-- 轮播s -->

		<div class="scroller" id="scroller">

			<ul id="thelist">

				{loop $sliders $item}

				<li>

					<a href="{if empty($item['link'])}#{else}{$item['link']}{/if}"> 

						<img src="{php echo toimage($item['picurl'])}" />

					</a>

				</li> 

				{/loop}

			</ul>

		</div>

	</div>

	<div id="J-album-nav">

		<ul id="indicator">

		{php $flag = false;} 

		{loop $sliders $item} 

			{if !$flag}

			<li class="active">1</li>

			{php $flag = true;} 

			{else}

			<li>1</li>

			{/if} 

		{/loop}

		</ul>

	</div>

	<div class="clr"></div>

</div>
<script type="text/javascript" src="../addons/tiger_jifenbao/template/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="../addons/tiger_jifenbao/template/js/iscroll.js"></script>
<script type="text/javascript" src="../addons/tiger_jifenbao/template/js/sweetalert.min.js"></script>

<script type="text/javascript">
		var click = false;
		function take(){
			{if !$follow}
			
			swal({

				title:'请先关注公众号！',

				text: '关注公众号后才能领取哦！亲', 

				confirmButtonColor: "#DD6B55",   

				confirmButtonText: "马上关注！",   

				type:'warning'

			},function(){
				{if $cfg['describeurl']}
				location.href= "{$cfg['describeurl']}";
				{/if}
			}); 
			
			return;
			{/if}
			
			if(!click){
				$.ajax({
					url: '{php echo $this->createMobileUrl("take",array("pid"=>$pid,"score"=>$items["score3"]))}',
					type:'post',
					success:function(msg){
						if(!isNaN(msg)){
							swal({
								title:'成功领取{$items["score3"]}{$name}！',
								text: '您剩余{$name}为：'+msg, 
								type:'success'
							},function(){
								{if $cfg['doneurl']}
								location.href= "{$cfg['doneurl']}";
								{else}
								location.reload();
								{/if}
							}); 
						}else{
							swal({
								title:msg,
								text: '', 
								type:'error'
							},function(){
								location.reload();
							}); 
						}
					},
					error:function(){
						swal('发送请求失败！','请检查网络后重试！','error');
						click = false;
					}
				});
				
				click = true;
			}
			
		}
	
		var myScroll;
		function loaded() {
			myScroll = new iScroll('J-album-wp', {
				snap : true,
				momentum : false,
				hScrollbar : false,
				onScrollEnd : function() {
					document.querySelector('#indicator > li.active').className = '';
					document.querySelector('#indicator > li:nth-child(' + (this.currPageX + 1) + ')').className = 'active';
				}
			});
		}
		document.addEventListener('DOMContentLoaded', loaded, false);
		var count = document.getElementById("thelist").getElementsByTagName("img").length;
		for ( i = 0; i < count; i++) {
			document.getElementById("thelist").getElementsByTagName("img").item(i).style.cssText = " width:" + document.body.clientWidth + "px";
		}

		document.getElementById("scroller").style.cssText = " width:" + document.body.clientWidth * count + "px";
		setInterval(function() {
			myScroll.scrollToPage('next', 0, 400, count);
		}, 3500);

		window.onresize = function() {
			for ( i = 0; i < count; i++) {
				document.getElementById("thelist").getElementsByTagName("img").item(i).style.cssText = " width:" + document.body.clientWidth + "px";
			}
			document.getElementById("scroller").style.cssText = " width:" + document.body.clientWidth * count + "px";
		}
</script>
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js?v=20150120"></script>

<script type="text/javascript">

	{php $signPackage = $_W['account']['jssdkconfig']}

    wx.config({

	    debug: false,

	    appId: "{$signPackage['appId']}",

	    timestamp: "{$signPackage['timestamp']}", 

	    nonceStr: "{$signPackage['nonceStr']}", 

	    signature: "{$signPackage['signature']}",

	    jsApiList: [

	        'checkJsApi',

	        'onMenuShareTimeline',

	        'onMenuShareAppMessage',

	        'onMenuShareQQ',

	        'onMenuShareWeibo'

	     ]

	});

        var shareData = {

        	      title: "{$cfg['sharetitle']}",

        	      link: "{php echo $this->createMobileUrl('qrcode',array('pid'=>$pid,'sid'=>$openid))}",

        	      desc: "{$cfg['sharedesc']}",

        	      imgUrl: "{php echo toimage($cfg['sharethumb'])}"

        	    };



        	wx.ready(function () {

        	    wx.onMenuShareAppMessage(shareData);

        	    wx.onMenuShareTimeline(shareData);

        	    wx.onMenuShareQQ(shareData);

        	    wx.onMenuShareWeibo(shareData);

        	});

</script>
</body>

</html>